#! /bin/bash 

rec_dir() 
{
    set -x
    local DIR="$1"
    set +x
    for f in `ls "$DIR"` 
    do 
        if [ -f "$DIR/$f" ]; then
            echo "$DIR/$f is regular file"
        elif [ -d "$DIR/$f" ]; then 
            echo "$DIR/$f is directory"
            rec_dir "$DIR/$f"
        else
            echo "$DIR/$f is not recognized"
        fi 
    done
}

rec_dir .

set -x
ls 
set +x
